package org.openmore.common.enums;

import java.util.HashMap;
import java.util.Map;

public enum PaymentType implements BaseEnum<PaymentType, String> {
    ALIPAY("ALIPAY", "支付宝"),
    WECHAT("WECHAT", "APP客户端支付"),
    WECHAT_MINIAPP("WECHAT_MINIAPP", "小程序支付"),
    WECHAT_H5("WECHAT_H5", "微信H5场景支付"),
    WECHAT_PAD("WECHAT_PAD", "APP-PAD客户端支付"),
    APP("APP", "APP内购"),
    IAP("IAP", "IAP");//苹果内购

    private String value;
    private String displayName;

    static Map<String, PaymentType> enumMap = new HashMap<String, PaymentType>();

    static {
        for (PaymentType type : PaymentType.values()) {
            enumMap.put(type.getValue(), type);
        }
    }

    private PaymentType(String value, String displayName) {
        this.value = value;
        this.displayName = displayName;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String getDisplayName() {
        return this.displayName;
    }

    public static PaymentType getEnum(String value) {
        return enumMap.get(value);
    }
}
